from selenium import webdriver
class BasePage():
   
    # 实例化BasePage类时，事先执行的__init__方法，该方法需要传递参数
    def __init__(self,driver):
        self.driver = driver
    
    # 进入网址
    def get(self, target_url):
        self.driver.get(target_url)

    #元素定位,替代八大定位
    def get_element(self,*locator):
        return self.driver.find_element(*locator)
    
    #点击
    def left_click(self,*locator):
       self.driver.find_element(*locator).click()

    #输入
    def send_text(self,text,*locator):
        self.driver.find_element(*locator).send_keys(text)

    #清除
    def clear_text(self, *locator):
        self.driver.find_element(*locator).clear()
